# LEEME


# Ideas u orden de desarrollo


## Fase 1. 

No automatico, un mod/admin debe meter al autoregistrado en la whitelist.

- Instalar Whitelist y manejar offline a quién se permite.

## Fase 2 de moderacion

Automático. El usuario al entrar pasa una validación.

- Validacion del estado: teleport al sitio o teleport al sitio y freeze.
- Usar Admin Toys para dejar el usuario en Freeze.
- Usar Whitelist e intentar que al registrar a alguien en la lista se "descongele".




- Recabar el correo electrónico -> envío de correo y verificación.
- Directamente te echa a los varios segundos.

## Fase 3 de moderacion

Moderacion durante el juego: hay comandos estandar, se puede mejorar con algún otro mod o hacer una pequeña interfaz. Habría que gestionar qué ocurre con el estado de la cuenta y el correo electrónico anotado.

---

**Lo de registrar correo electrónico implica desplegar un servicio para el token enviado al email (o usar el que he puesto el tipo del mod)**

Idea:

---

# LUA

~~~
Los lugares de carga de un mod
For a given world/save game, three mod locations are checked. They are, in order:

    - Game mods. These are the mods that form the game that the world is running. Eg: minetest/games/minetest_game/mods/, /usr/share/minetest/games/minetest/

    - Global mods, the location to which mods are nearly always installed to. If in doubt, place them here. Eg: minetest/mods/

    - World mods, the location to store mods which are specific to a particular world. Eg: minetest/worlds/world/worldmods/
~~~




~~~
en mod.conf

depends = modone, modtwo
optional_depends = modthree


Las dependencias opcionales permiten el juego pero harán que haya cosas que no funcionen.


~~~


    Existen los modpacks
    modpack/
        modpack.conf
        mod1/
        mod2/


Locals should be used as much as possible

Local variables should be used whenever possible. Mods **should only create one global at most, with the same name as the mod.**

Funciones


Functions are variables of a special type, but should also be made local, because other mods could have functions with the same names.
~~~lua
local function foo(bar)
    return bar * 2
end
~~~

Permitir el acceso a las funciones a otros mods:


To allow mods to call your functions, you should create a table with the same name as the mod and add your function to it. This table is often called an API table or namespace.
~~~lua
mymod = {}

function mymod.foo(bar)
    return "foo" .. bar
end

-- In another mod, or script:
mymod.foo("foobar")
~~~
function mymod.foo() is equivalent to mymod.foo = function(), it’s just a nicer way to write it.

**Including other Lua Scripts**

The recommended way to include other Lua scripts in a mod is to use dofile.
~~~lua
dofile(minetest.get_modpath("modname") .. "/script.lua")

A script can return a value, which is useful for sharing private locals:

-- script.lua
local module = {}
module.message = "Hello World!"
return module

-- init.lua
local ret = dofile(minetest.get_modpath("modname") .. "/script.lua")
print(ret.message) -- Hello world!
~~~

## NODOS ITEMS

- item
    - nodo: colocable
    - craftitem: objeto caido y en inventario
    - tool: también

Item name y definition table

Both modname and itemname should only contain lowercase letters, numbers, and underscores.

~~~lua
minetest.register_....item("modname:itemname", 
    {
        descrpition = "",
        inventory_image = ""


    }
)

minetest.register_alias("dirt", "default:dirt")
~~~

PNG format.

Textures in Minetest are usually 16 by 16 pixels. They can be any resolution, but it is recommended that they are in the order of 2, for example, 16, 32, 64, or 128. This is because other resolutions may not be supported correctly on older devices, especially phones, resulting in degraded performance.

~~~lua
minetest.register_node("mymod:diamond", {
    description = "Alien Diamond",
    tiles = {"mymod_diamond.png"},
    is_ground_content = true,
    groups = {cracky=3, stone=1}
})
~~~

Crafting:

    minetest.register_craft({
        type = "shaped",
        output = "mymod:diamond_chair 99",
        recipe = {
            {"mymod:diamond_fragments", "",                         ""},
            {"mymod:diamond_fragments", "mymod:diamond_fragments",  ""},
            {"mymod:diamond_fragments", "mymod:diamond_fragments",  ""}
        }
    })


- shaped - Ingredients must be in the correct position.
- shapeless - It doesn’t matter where the ingredients are, just .that there is the right amount.
- cooking - Recipes for the furnace to use.
- fuel - Defines items which can be burned in furnaces.
- tool_repair - Defines items which can be tool repaired.

~~~lua
    minetest.register_craft({
        type = "cooking",
        output = "mymod:diamond_fragments",
        recipe = "default:coalblock",
        cooktime = 10,
    })

    minetest.register_tool("mymod:tool", {
    description = "My Tool",
    inventory_image = "mymod_tool.png",
    tool_capabilities = {
        full_punch_interval = 1.5,
        max_drop_level = 1,
        groupcaps = {
            crumbly = {
                maxlevel = 2,
                uses = 20,
                times = { [1]=1.60, [2]=1.20, [3]=0.80 }
            },
        },
        damage_groups = {fleshy=2},
    },
})
~~~

Item callbacks:
||||
|--|--|--|
|on_use |	left-click |	nil|
|on_place |	right-click on a node | minetest.item_place|
|on_secondary_use 1	right-click not on a node |	minetest.|
|item_secondary_use |(does nothing)||
|on_drop |	Q 	|minetest.item_drop|
|after_use |	digging a node| 	nil|


    minetest.register_chatcommand("foo", {
    privs = {
        interact = true,
    },
    func = function(name, param)
        return true, "You said " .. param .. "!"
    end,
    })




    